package com.mrx.spring.example.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author Mr.X
 * @since 2023-11-15 13:43
 **/
@Mapper
public interface TestMapper {

    @Select("select current_timestamp;")
    Date now();

    @Update("create table test(id int not null)")
    void initTable();

    @Select("select * from test")
    List<Map<String, String>> listAll();

    @Insert("insert into test(id)values(#{id})")
    void insert(Integer id);
}
